home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
BASIC
/
0006.ZIP
/
COTITL.ASM
< prev
next >
Wrap
Assembly Source File
|
1983-06-16
|
1KB
|
63 lines
TITLE COTITL - Diskette Contents List - Get Title
SUBTTL Version 1.0 - June 1983
PAGE 81,132
;
CODE SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:CODE,DS:CODE
;
PUBLIC TITLX,FREE
TPRMT DB 13,10,'Enter Title: $'
TBUF DB 40,0 ;Input buffer for user title
DB 40 DUP (?)
TITLX DB 13 DUP (' ') ;Title line
TIL1 DB 42 DUP (' ')
DB 'Free: '
FREE DB 9 DUP (' ') ;Formatted free space in title line
MONTH DB ' /' ;Date fields in title line
DAY DB ' /'
YEAR DB ' ',0 ;End of title
;
PUBLIC GETTTL
GETTTL PROC NEAR
MOV DI,OFFSET TITLX
MOV CX,55
MOV AL,' '
REP STOSB ;Clear title line
MOV DX,OFFSET TPRMT
MOV AH,9
INT 21H ;Prompt for title
MOV DX,OFFSET TBUF
MOV AH,0AH
INT 21H ;Get user title
MOV CL,TBUF+1 ;Load length
XOR CH,CH
MOV SI,OFFSET TBUF+2
MOV DI,OFFSET TIL1
REP MOVSB ;Move user title to title line
MOV AH,2AH
INT 21H ;Get date
SUB CX,1900 ;Convert to two digit year
MOV DI,OFFSET YEAR
MOV AL,CL
CALL DECMAL ;Fill in month/day/year
MOV DI,OFFSET MONTH
MOV AL,DH ; for title line
CALL DECMAL
MOV DI,OFFSET DAY
MOV AL,DL
CALL DECMAL
RET
GETTTL ENDP
;
DECMAL PROC NEAR ;Converts AL to two decimal
AAM ; digits and stores at SI
OR AX,'00'
XCHG AL,AH
STOSW ;Save in image
RET
DECMAL ENDP
;
CODE ENDS
;
END